//
//  JYJProgramModel.h
//  HappyListen
//
//  Created by 冀永金 on 16/9/1.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "BaseModel.h"
#import <UIKit/UIKit.h>

@class JYJMusicOperation;
@class JYJProgramModel;
typedef NS_ENUM(NSInteger, JYJMusicStatus) {
    kJYJMusicStatusNone = 0,       // 初始状态
    kJYJMusicStatusRunning = 1,    // 下载中
    kJYJMusicStatusSuspended = 2,  // 下载暂停
    kJYJMusicStatusCompleted = 3,  // 下载完成
    kJYJMusicStatusFailed  = 4,    // 下载失败
    kJYJMusicStatusWaiting = 5    // 等待下载
    //  kHYBVideoStatusCancel = 6      // 取消下载
};

typedef void(^JYJMusicStatusChanged)(JYJProgramModel *model);
typedef void(^JYJMusicProgressChanged)(JYJProgramModel *model);
@interface JYJProgramModel : BaseModel<NSCoding>
@property (nonatomic, assign)NSInteger music_duration;
@property (nonatomic, assign)NSInteger music_comments;
@property (nonatomic, assign)NSInteger music_id;
@property (nonatomic, copy)NSString *music_media;
@property (nonatomic, assign)NSInteger music_recomms;
@property (nonatomic, assign)NSInteger music_collects;
@property (nonatomic, assign)NSInteger music_views;
@property (nonatomic, assign)NSInteger item_id;
@property (nonatomic, copy)NSString *music_tags;
@property (nonatomic, copy)NSString *music_title;
@property (nonatomic, copy)NSString *music_img;
@property (nonatomic, copy)NSString *music_user;
@property (nonatomic, copy)NSString *music_desc;
@property (nonatomic, assign)NSInteger music_downs;


@property (nonatomic, strong) NSData *resumeData;
// 下载后存储到此处
@property (nonatomic, copy) NSString *localPath;
@property (nonatomic, assign) CGFloat progress;
@property (nonatomic, copy) NSString *progressText;
@property (nonatomic, assign) JYJMusicStatus status;
@property (nonatomic, strong) JYJMusicOperation *operation;
@property (nonatomic, copy) JYJMusicStatusChanged onStatusChanged;
@property (nonatomic ,copy) JYJMusicStatusChanged onProgressChanged;

@property (nonatomic, readonly, copy) NSString *statusText;
@end
